<template>
    <div>
        <el-breadcrumb separator="/">
          <el-breadcrumb-item>系统管理</el-breadcrumb-item>
          <el-breadcrumb-item>地址信息</el-breadcrumb-item>
        </el-breadcrumb>
        
          <el-table
            :data="usersS"
            border
            style="width: 100%; margin-top: 15px;"
            :span-method="objectSpanMethod"
            >
          <el-table-column
            
            label="用户姓名"
            width="150">{{xinming}}
          </el-table-column>
          <el-table-column
            prop="receiverName"
            label="收货姓名"
            width="200">
          </el-table-column>
           <el-table-column
            prop="receiverMobile"
            label="手机号"
            width="250">
          </el-table-column>
          <el-table-column
            prop="province"
            label="省"
            width="100">
          </el-table-column>
           <el-table-column
            prop="city"
            label="市"
            width="100">
          </el-table-column>
          <el-table-column
            prop="area"
            label="区"
            width="100">
          </el-table-column>
          <el-table-column
            prop="addr"
            label="街道">
          </el-table-column>
          
      </el-table>
      <div style="display: flex; justify-content: center;">
        <el-pagination
          background
          layout="prev, pager, next"
          @current-change="goto"
          :total="total"
          page-size=1>
        </el-pagination>
      </div>
      
    </div>
</template>
<script>
import http from "@/core/httpRequest.js";
export default {
  data() {
    return {
      users: [],
      xinming:null,
      usersS: [],
      total: 0 ,
      gridData:[],
      dialogTableVisible: false,
       gaoLiang:true,
      formLabelWidth: '120px'     
    }
  },
  mounted() {
    this.goto(1)
  },
  methods: {
    goto(page) {
        let shu = page-1
      http.get(`/usersAddrList`).then(res => {
          this.total = res.data.data.total
          this.users= res.data.data.user[shu]
          this.xinming = this.users.username
          this.usersS=this.users.userAddrs
          if(this.usersS.length==0){
              this.usersS=[{receiverName:null,receiverMobile:null,province:null,city:null,area:null}]
          }
          
          
      })
    },

 objectSpanMethod({  rowIndex,columnIndex }) {
        if (columnIndex === 0) {
          if (rowIndex  === 0) {
            return {
              rowspan: this.usersS.length,
              colspan: 1
              
            };
          } else {
            return {
              rowspan: 0,
              colspan: 0
            };
          }
        }
      }
    }
  };
  

</script>

<style>
</style>